<script setup lang="ts">
import { useRouter } from "vue-router";
import { ref } from "@vue/reactivity";
import headers from "@/components/common/headers.vue";
import footers from "@/components/common/footers.vue";
import navs from "@/components/complaint/navs.vue";
import personInfor from "@/components/complaint/personInfor.vue";
import complaintInfor from "@/components/complaint/complaintInfor.vue";
import success from "@/components/complaint/success.vue";
// 路由管理
const router = useRouter();
// 打开页面
let open = (path: string): void => {
  if (!path) return;
  router.push({ path });
};

let step = ref(0);
</script>

<template>
  <div class="enterprise">
    <!-- 头部信息 -->
    <headers nexts="个人中心" />

    <!-- 中间内容区域 -->
    <div class="main">
      <h1>个人投诉</h1>
      <!-- 进度条 -->
      <navs :step="step" />
      <!-- 填写个人信息表单内容 -->
      <personInfor v-model:step="step" v-if="step == 0" />
      <!-- 投诉信息 -->
      <complaintInfor v-model:step="step" v-else-if="step == 1" />
      <!-- 完成投诉 -->
      <success v-else @open="open" />
    </div>

    <!-- 底部单位信息 -->
    <footers />
  </div>
</template>

<style scoped lang="scss">
.enterprise {
  width: 100%;
  padding-top: 45px;
  // 背景图片
  background: #f1f2f3 url("@/assets/my/bg.webp") no-repeat fixed center top;
  background-size: 100% 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px 0px;
}
.main {
  width: 1000px;
  height: 768px;
  // 竖直居中
  @include flexColumnCenter;
  gap: 0px 16px;
  background-color: #fff;
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  margin-bottom: 64px;
  padding-top: 48px;
}
h1 {
  width: 128px;
  height: 45px;
  font-size: 32px;
  font-weight: 600;
  color: #333333;
  line-height: 45px;
}
</style>
